package Brain;

public interface Stack<E> {
    /**
     * Agrega elemento a la pila
     * @param item 
     * @pre 
     * @post item is added to stack
     */
    public void push(E item);
    
    /**
     * @pre stack is not empty
     * @post most recently pushed item is removed and returned
     * @return Last element of the stack
     */
    public E pop();
    
    /**
     * @pre stack is not empty
     * @post top value (next to be popped) is returned
     * @return top value
     */
    public E peek();
    
    /**
     * @post returns true if and only if the stack is empty
     * @return true if the stack is empty
     */
    public boolean empty();
    
    /**
     * Returns the number of elements in the stack
     * @return Elements on the stack
     */
    public int size();
    
}
